#ifndef _CR_LOG_H_FL_
#define _CR_LOG_H_FL_

#include "Config.h"

#if OS_ALVA==OS_Android

#include <jni.h>
#include <android/log.h>
#if DebugInfo_Switch == Release_Alva

#define  LOGI(...)  
#define  LOGD(...)  
#define  LOGV(...)  
#define  LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
#define  LOGS(mString)  

#else

#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
#define  LOGV(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
#define  LOGS(mString)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG, "%s", mString)

#endif //DebugInfo_Switch
#endif //OS_ALVA

#if OS_ALVA==OS_Windows
#include <Windows.h>
#include <stdio.h>

#if DebugInfo_Switch == Release_Alva

#define  LOGI(...)  
#define  LOGD(...)  
#define  LOGV(...)  
#define  LOGE(...)  {\
                        char temp[8192] = {0};      \
                        sprintf_s(temp, 8192, __VA_ARGS__); \
                        printf("%s\n", temp);OutputDebugStringA(temp);    \
                    }
#define  LOGS(mString)  

#else

#define  LOGI(...)  {\
                        char temp[8192] = {0};      \
                        sprintf_s(temp, 8192, __VA_ARGS__); \
                        printf("%s\n", temp);OutputDebugStringA(temp);    \
                    }
#define  LOGD(...)  {\
                        char temp[1024] = {0};      \
                        sprintf_s(temp, 1024, __VA_ARGS__); \
                        printf("%s\n", temp);OutputDebugStringA(temp);    \
                    }
#define  LOGV(...)  {\
                        char temp[1024] = {0};      \
                        sprintf_s(temp, 1024, __VA_ARGS__); \
                        printf("%s\n", temp);OutputDebugStringA(temp);    \
                    }
#define  LOGE(...)  {\
                        char temp[8192] = {0};      \
                        sprintf_s(temp, 8192, __VA_ARGS__); \
                        printf("%s\n", temp);OutputDebugStringA(temp);    \
                    }

#define  LOGS(mString)  {\
                        printf("%s\n", mString);OutputDebugStringA(mString);    \
                    }
#endif //DebugInfo_Switch
#endif //OS_ALVA

#if OS_ALVA==OS_Linux || OS_ALVA==OS_iOS

#if DebugInfo_Switch == Release_Alva

#define  LOGI(...)  
#define  LOGD(...)  
#define  LOGV(...)  
#define  LOGE(...) printf(__VA_ARGS__);
#define  LOGS(mString)  

#else

#define  LOGI(...)  printf(__VA_ARGS__);
#define  LOGD(...)  printf(__VA_ARGS__);
#define  LOGV(...)  printf(__VA_ARGS__);
#define  LOGE(...)  printf(__VA_ARGS__);
#define  LOGS(mString) printf("%s\n", mString);

#endif //DebugInfo_Switch
#endif //OS_ALVA

#endif //_CR_LOG_H_FL_